package com.javatom.notes.common.config.redis;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @description: 分布式锁配置项
 * @author: 曾维录
 * @time: 2019/7/29 15:06
 */
@Component
@ConfigurationProperties(prefix ="redisson.server")
@Data
@ConditionalOnProperty(prefix = "redisson.server", name = "enabled", havingValue = "true")
public class RedissonProperties {
    /**
     * redis主机地址，ip：port，有多个用半角逗号分隔
     */
    private String address;

    /**
     * 连接类型，支持standalone-单机节点，sentinel-哨兵，cluster-集群，masterslave-主从
     */
    private String type;

    /**
     * redis 连接密码
     */
    private String password;

    /**
     * 选取那个数据库
     */
    private int database;

    /**
     * 端口
     */
    private String port;
}
